package com.wyw.design.model.learning.structure.proxy;

/**
 * @Title   静态代理测试类
 * @Description
 * @Author Mr Wu    yewen.wu.china@gmail.com
 * Update History:
 * Author        Time            Content
 */
public class StaticProxyClient {
//    public static void main(String[] args) {
//        String name = "hello";
//
//        IBuyer buyer = new Buyer(name);
//        // 登录
//        buyer.login(name, "123456");
//        // 开始购票
//        buyer.bugTicket();
//    }

    // 使用代理类
    public static void main(String[] args) {
        // 使用代理类完成购票操作
        String name = "hello";
        IBuyer buyer = new Buyer(name);
        IBuyer proxyBuyer = new BuyerProxy(buyer);
        proxyBuyer.login(name, "123456");
        proxyBuyer.bugTicket();
    }
}
